package com.zhoushihao.class0818;

import java.util.*;

public class LogicClass {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<CheckPoint> pointList = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            pointList.add(new CheckPoint(sc.nextInt(), sc.nextInt(), sc.next()));
        }
        for (int i = 0; i < m; i++) {
            int A = sc.nextInt();
            int B = sc.nextInt();
            int C = sc.nextInt();
            List<Long> AList = new ArrayList<>();
            List<Long> BList = new ArrayList<>();
            int count_a = 0;
            int count_b = 0;
            for (int j = 0; j < pointList.size(); j++) {
                if (pointList.get(j).class_name.equals("A")) {
                    AList.add(pointList.get(j).calculate(A, B, C));
                    if(pointList.get(j).calculate(A, B, C)>0){
                        count_a++;
                    }
                } else {
                    BList.add(pointList.get(j).calculate(A, B, C));
                    if(pointList.get(j).calculate(A, B, C)>0){
                        count_b++;
                    }
                }
            }
            if (count_a == 0 && count_b == BList.size() || count_a == AList.size() && count_b == 0) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
    }
}

class CheckPoint {
    int x, y;
    String class_name;

    public CheckPoint(int x, int y, String class_name) {
        this.x = x;
        this.y = y;
        this.class_name = class_name;
    }

    public long calculate(int A, int B, int C) {
        return A + (long) B * x + (long) C * y;
    }
}
